package cn.ht.jywrwater.module.ht.dal.mysql.villagemeterdevice;

import java.util.*;

import cn.ht.jywrwater.framework.common.pojo.PageResult;
import cn.ht.jywrwater.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.ht.jywrwater.framework.mybatis.core.mapper.BaseMapperX;
import cn.ht.jywrwater.module.ht.dal.dataobject.villagemeterdevice.VillageMeterDeviceDO;
import org.apache.ibatis.annotations.Mapper;
import cn.ht.jywrwater.module.ht.controller.admin.villagemeterdevice.vo.*;

/**
 * 大口径流量 Mapper
 *
 * @author hzx
 */
@Mapper
public interface VillageMeterDeviceMapper extends BaseMapperX<VillageMeterDeviceDO> {

    default PageResult<VillageMeterDeviceDO> selectPage(VillageMeterDevicePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<VillageMeterDeviceDO>()
                .eqIfPresent(VillageMeterDeviceDO::getMeterCode, reqVO.getMeterCode())
                .eqIfPresent(VillageMeterDeviceDO::getVillage, reqVO.getVillage())
                .betweenIfPresent(VillageMeterDeviceDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(VillageMeterDeviceDO::getId));
    }

    default List<VillageMeterDeviceDO> selectList(VillageMeterDeviceExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<VillageMeterDeviceDO>()
                .eqIfPresent(VillageMeterDeviceDO::getMeterCode, reqVO.getMeterCode())
                .eqIfPresent(VillageMeterDeviceDO::getVillage, reqVO.getVillage())
                .betweenIfPresent(VillageMeterDeviceDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(VillageMeterDeviceDO::getId));
    }

}
